package com.lizemin.common.entity;

import lombok.Getter;

/**
 * @author lzm
 * @date 2025/3/23 12:20
 * @description
 */
@Getter
public class RespBean {

    private Integer code;

    private String message;

    private Object data;

    private RespBean() {
    }

    public static RespBean success(Object data) {
        RespBean resp = new RespBean();
        resp.code = 200;
        resp.message = "success";
        resp.data = data;
        return resp;
    }

    public static RespBean success() {
        return success(null);
    }

    public RespBean message(String message) {
        this.message = message;
        return this;
    }

    public static RespBean fail(String message) {
        RespBean resp = new RespBean();
        resp.code = 500;
        resp.message = message;
        return resp;
    }

}
